package com.hust.bridgecheck.repository;

import com.hust.bridgecheck.entity.Sensor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface SensorRepository extends JpaRepository<Sensor,Integer> {
    //根据桥ID来获取数据
    @Query(value = "select * from sensor where bridge_id=?1", nativeQuery = true)
    List<Sensor> getByBridgeId(Integer bridgeID);
}
